﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Collections.Generic;

public partial class Admin_Main_m_Main_Admin : System.Web.UI.UserControl
{
    #region[Refresh]
    void Refresh()
    {
        Response.Redirect("admin.aspx");
    }
    #endregion
    string uID = "";
    #region[Page load]
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["uid"] != null) { uID = Session["uid"].ToString(); }
        string hoten = "";
        if (Session["hoten"] != null)
        {
            hoten = Session["hoten"].ToString();
            lbthoten.Text = "Xin chào : " + hoten;
        }
        if (!IsPostBack) { Viewinformation(); }
    }
    #endregion
    #region[Viewinformation]
    void Viewinformation()
    {
        List<tbUsersDATA> list = tbUserDB.tbUsers_GetByID(uID);
        if (list.Count > 0)
        {
            lbtHotenleft.Text = "Họ tên: " + list[0].uName;
            lbtPhongban.Text = "Phòng ban: " + list[0].dpName;
            lbtChucvu.Text = "Chức vụ: " + list[0].psName;
        }
        list.Clear();
        list = null;
    }
    #endregion
    #region[out ra trang admin]
    protected void lbtthoat_Click(object sender, EventArgs e)
    {
        Session["id"] = null;
        Session["p"] = null;
        Session["c"] = null;
        Response.Redirect("admin.aspx");
    }
    #endregion   
    protected void lbtchangepasstit_Click(object sender, EventArgs e)
    {
        Session["c"] = "chagepass";
        Refresh();
    }
    protected void lbthoten_Click(object sender, EventArgs e)
    {
        Session["c"] = "ttcn";
        Refresh();
    }
    protected void lbtThongtincanhan_Click(object sender, EventArgs e)
    {
        Session["c"] = "ttcn";
        Refresh();
    }
    protected void lbtHotenleft_Click(object sender, EventArgs e)
    {
        Session["c"] = "ttcn";
        Refresh();
    }
    protected void lbtPhongban_Click(object sender, EventArgs e)
    {
        Session["c"] = "ttcn";
        Refresh();
    }
    protected void lbtChucvu_Click(object sender, EventArgs e)
    {
        Session["c"] = "ttcn";
        Refresh();
    }
}
